package com.hy.appbase.apiresult;

import lombok.Data;

/**
 * Created by king on 2017/12/9.
 */
@Data
public class ApiResult {

    private int status;

    private String message;

    public ApiResult(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public static ApiResult SUCCESS() {
        return new ApiResult(ApiResultType.SUCCESS.getValue(), ApiResultMessage.SUCCESS.getMessage());
    }

    public static ApiResult SUCCESS(String message) {
        return new ApiResult(ApiResultType.SUCCESS.getValue(), message);
    }

    public static ApiResult FAIL() {
        return new ApiResult(ApiResultType.FAIL.getValue(), ApiResultMessage.FAIL.getMessage());
    }

    public static ApiResult FAIL(String message) {
        return new ApiResult(ApiResultType.FAIL.getValue(), message);
    }
}
